<template>
	<view>
		<view style="display: inline-block;margin-top: 10px;">
			<button class="bottom-publish" @click="clickPublish(false)" style="margin-right: 176px;background-color:#C0C0C0">取消</button>
			<button class="bottom-publish" @click="clickPublish(true)">发布</button>
		</view>
		<view style="border-bottom: 1px solid #C0C0C0;margin-top: 20px;width: 94%;margin-left: 10px;">
			<input placeholder="文章标题" v-model="article.article_title" type="text" style="font-size: 16px;margin: 10px 10px;" />
		</view>
		<jin-edit placeholder="请输入内容" v-model="article.article_content" uploadFileUrl="/#" @editOk="editOk"></jin-edit>
	</view>
</template>

<script>
	import jinEdit from '../../components/jin-edit/jin-edit.vue';
	import APP from '../../App.vue';
	export default {
		components:{
			jinEdit
		},
		data() {
			return {
				article:{article_title:'',article_content:''}
			}
		},
		methods: {
			clickPublish:function(isPublic){
				if(isPublic){
					uni.navigateTo({
						url:"../pages/index/index"
					})
				}else{
					uni.navigateBack({
						
					})
				}
			},
			// 点击发布
			editOk(res) {
				console.log(res);
				this.article.article_content = res.html;
				console.log(this.article);
			}
		}
	}
</script>

<style>
	.bottom-publish{
		display: block;
		float: left;
		text-align: center;
		width: 140rpx;
		height: 60rpx;
		background: #56A0D3;
		font-size: 24rpx;
		margin: auto 0 auto 20rpx;
		color: #fff;
		font-size: 12px;
		border-radius: 10rpx;
	}
</style>
